    var fwTPZ_js_UserOS      = getOSInfo();
    var fwTPZ_js_UserBrowser = getBrowserInfo();
    var objXmlHttp          = null;

    var AJAXReturnString    = null;
    var AJAXReturnJSON      = null;


  // 첨부 파일 관련
    var countAttachFile                    = 0;
    var maxAttachFile                      = 0;


// ----------------------------------------------------------------------------
//   Browser, OS 관련
// ----------------------------------------------------------------------------
    function getBrowserInfo( )
    {
        var name    = navigator.appName             ;
        var ver     = navigator.appVersion          ;
        var ver_int = parseInt(navigator.appVersion);
        var ua      = navigator.userAgent           ;
        var infostr                                 ;

        if ( name == "Microsoft Internet Explorer" ) {
            if (ver.indexOf("MSIE 3.0") != -1)                       return    "Internet Explorer 3.0x";
            if (ver_int != 4                 )                       return    "Internet Explorer "+ver.substring(0, ver.indexOf(" "));

            var real_ver = parseInt(ua.substring(ua.indexOf("MSIE ") + 5));
            if ( real_ver >= 7 )                                     infostr = "Windows Internet Explorer ";
                else                                                 infostr = "Microsoft Internet Explorer ";

            if ( ua.indexOf("MSIE 5.5") != -1 )                      return    infostr+"5.5";
                else                                                 return    infostr+real_ver+".x";

            return "Internet Explorer";
        }
        else if ( name == "Netscape" ) {
            if ( parseInt(ua.substring(8, 8)) <= 4 )                 return    "Netscape " + ver.substring(0, ver.indexOf(" "));
            else if ( ua.lastIndexOf(" ") > ua.lastIndexOf("/") )    return    ua.substring(ua.lastIndexOf(" "));
                     else                                            return    "Netscape";
        }
        else return name;
    }

    function getOSInfo( )
    {
        var ua = navigator.userAgent;

             if (ua.indexOf("NT 6.0")    != -1) return "Windows Vista/Server 2008";
        else if (ua.indexOf("NT 5.2")    != -1) return "Windows Server 2003";
        else if (ua.indexOf("NT 5.1")    != -1) return "Windows XP";
        else if (ua.indexOf("NT 5.0")    != -1) return "Windows 2000";
        else if (ua.indexOf("NT")        != -1) return "Windows NT";
        else if (ua.indexOf("9x 4.90")   != -1) return "Windows Me";
        else if (ua.indexOf("98")        != -1) return "Windows 98";
        else if (ua.indexOf("95")        != -1) return "Windows 95";
        else if (ua.indexOf("Win16")     != -1) return "Windows 3.x";
        else if (ua.indexOf("Windows")   != -1) return "Windows";
        else if (ua.indexOf("Linux")     != -1) return "Linux";
        else if (ua.indexOf("Macintosh") != -1) return "Macintosh";
        else return "";
    }


    function getOuterHTML( obj )
    {
        var strReturn = "";

        if ( obj.outerHTML ) {    strReturn=obj.outerHTML;                                 }
        else                 {    strReturn=(new XMLSerializer).serializeToString(obj);    }
    }
// ----------------------------------------------------------------------------
//  날짜 관련
// ----------------------------------------------------------------------------
    function getCustomDate( returnPattern )
    {
        var today            = new Date();
        var strReturn        = "";

        switch ( returnPatter ) {
            case "YYYY-mm-dd": {
                strReturn =     (today.getYear()+1900)
                          + "-"+(((today.getMonth()+1)<10)?"0":"")+(today.getMonth()+1)
                          + "-"+((today.getDate()<10)?"0":"")+today.getDate()
                          ;
                break;
            }
            case "YYYY.mm.dd": {
                strReturn =     (today.getYear()+1900)
                          + "."+(((today.getMonth()+1)<10)?"0":"")+(today.getMonth()+1)
                          + "."+((today.getDate()<10)?"0":"")+today.getDate()
                          ;
                break;
            }
            case "YYYYmmdd": {
                strReturn =     (today.getYear()+1900)
                          +     (((today.getMonth()+1)<10)?"0":"")+(today.getMonth()+1)
                          +     ((today.getDate()<10)?"0":"")+today.getDate()
                          ;
                break;
            }

            case "hh:ii:ss": {
                strReturn =     ((today.getHours()<10)?"0":"")+today.getHours()
                          + ":"+((today.getMinutes()<10)?"0":"")+(today.getMinutes()+1)
                          + ":"+((today.getSeconds()<10)?"0":"")+today.getSeconds()
                          ;
                break;
            }
            case "hhiiss": {
                strReturn =     ((today.getHours()<10)?"0":"")+today.getHours()
                          +     ((today.getMinutes()<10)?"0":"")+(today.getMinutes()+1)
                          +     ((today.getSeconds()<10)?"0":"")+today.getSeconds()
                          ;
                break;
            }

        }

        return strReturn;
    }

// ----------------------------------------------------------------------------
//   Ajax & JSON & XMLHTTP
// ----------------------------------------------------------------------------
    function getXmlHttpObject( )
    {
        if ( window.XMLHttpRequest ) {    // code for IE7+, Firefox, Chrome, Opera, Safari
            return new XMLHttpRequest();
        }
        if ( window.ActiveXObject ) {     // code for IE6, IE5
            return new ActiveXObject("Microsoft.XMLHTTP");
        }
        return null;
    }

    function XmlHttpSubmit( frmName, actionURL, strMethod )
    {
        var params = $("#"+frmName).serialize();

        objXmlHttp = getXmlHttpObject();
        objXmlHttp.open( strMethod, actionURL, true );
        objXmlHttp.onreadystatechange = getXmlHttpResponse;
        objXmlHttp.send(params);
    }

    function getXmlHttpResponse( )
    {
        if ( objXmlHttp.readyState == 4 ) {
            if ( objXmlHttp.responseText == '' ) {
                alert('Sorry, there was an error during process.');
            }
            else
            {
                try {
                    AJAXReturnString = objXmlHttp.responseText;
                    AJAXReturnJSON   = jQuery.parseJSON(objXmlHttp.responseText);
                }
                catch( e ) {
                    alert('Sorry, there was an error during retrieving the result.\n\n' + e.toString() );
                }
            }
        }
    }



// ----------------------------------------------------------------------------
//   입력 관련
// ----------------------------------------------------------------------------
  // 숫자만 입력
    function isNumber( Ev )
    {
        var evCode = ( window.netscape )?Ev.which:event.keyCode;

        if ( !(evCode==0 || evCode==8 || (evCode>47 && evCode<58) ) ) {
            alert( "숫자를 넣어주세요." );
            if ( window.netscape ) {    Ev.preventDefault();          }
                else               {    event.returnValue = false;    }
        }
    }



// ----------------------------------------------------------------------------
//   String, URL 관련
// ----------------------------------------------------------------------------
    function replaceAll( target, replacee, replacer )
    {
        var ret = "";
        retStr  = "" + target;

        while (retStr.indexOf(replacee)>-1) {
            pos    = retStr.indexOf(replacee);
            retStr = "" + (retStr.substring(0, pos) + replacer + retStr.substring((pos + replacee.length), retStr.length));
        }
        return retStr;
    }

    function setComma( number )
    {
        number = '' + number;

        if (number.length > 3) {
            var mod = number.length % 3;
            var output = (mod > 0 ? (number.substring(0,mod)) : '');
            for (i=0 ; i < Math.floor(number.length / 3); i++) {
                if ((mod == 0) && (i == 0))
                    output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
                else
                    output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);
            }
            return (output);
        }
        else
            return number;
    }

    function URLencode( target )
    {
        return encodeURIComponent(target);
    }
    function URLdecode( target )
    {
        return decodeURIComponent(target);
    }
    
    function ltrim( strSource )
    {
        return strSource.replace(/^\s+/,"");
    }

    function rtrim( strSource )
    {
        return strSource.replace(/\s+$/,"");
    }

    function trim( strSource )
    {
        return strSource.replace(/^\s+|\s+$/g,"");
    }
    function removeComma( strSource )
    {
         str = parseInt(strSource.replace(/,/g, ""));
         return str;
    }





    String.prototype.trim = function() {
        return this.replace(/^\s+|\s+$/g,"");
    }
    String.prototype.ltrim = function() {
        return this.replace(/^\s+/,"");
    }
    String.prototype.rtrim = function() {
        return this.replace(/\s+$/,"");
    }
    String.prototype.removeComma = function() {
        return parseInt(strSource.replace(/,/g, ""));
    }

// ----------------------------------------------------------------------------
//   Cookie 관련
// ----------------------------------------------------------------------------
    function setCookie( name, value, expiredays )
    {
        var todayDate = new Date();
        todayDate.setDate( todayDate.getDate() + expiredays );
        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
    }

    function getCookie( name )
    {
        var nameOfCookie = name + "=";
        var x            = 0;
        var y            = 0;

        while ( x <= document.cookie.length ) {
            y = (x+nameOfCookie.length);
            if ( document.cookie.substring( x, y ) == nameOfCookie ) {
                if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
                    endOfCookie = document.cookie.length;
                return unescape( document.cookie.substring( y, endOfCookie ) );
            }
            x = document.cookie.indexOf( " ", x ) + 1;
            if ( x == 0 )
                break;
        }
        return "";
    }





    function appendRow( objTrName ) 
    {
        var tr_obj    = document.getElementById( objTrName );
        var clone_obj = tr_obj.cloneNode(true);
            tr_obj.parentNode.appendChild(clone_obj);
            clone_obj.style.display = "";
    }

    
    function deleteRow( objName ) 
    {
        var objTarget = document.getElementsByName(objName);
        var objDelete = null;
        
        for ( cnt=objTarget.length-1; cnt>=0; cnt-- ) {
            if ( objTarget[cnt].checked == true ) {
                objDelete = eval(objTarget[cnt].parentNode);
                objDelete.parentNode.parentNode.removeChild( objDelete.parentNode );
            }
        }
    }
    
    function checkedAll( objSrc, objName )
    {
        var objTarget = document.getElementsByName(objName);
        
        for ( cnt=0; cnt<objTarget.length; cnt++ ) {
            objTarget[cnt].checked = objSrc.checked;
        }        
    }
    
    function getRadioValue( objName )
    {
        var objTarget = document.getElementsByName( objName );
        var returnValue = "";
        
        for ( cnt=0; cnt<objTarget.length; cnt++ ) {
            if ( objTarget[cnt].checked ) {    returnValue = objTarget[cnt].value;    break;    }
        }
        
        return returnValue;        
    }




// ----------------------------------------------------------------------------
//   Validation
// ----------------------------------------------------------------------------
    function ntValidator( arrayValidate )
    {
        var returnValue  = true;
        var targetObject   ;
        var tempValue      ;

        if ( arrayValidate.length ) {
            for ( cnt=0; cnt<arrayValidate.length; cnt++ ) {
                targetObject = arrayValidate[cnt][0];
                tmp          = arrayValidate[cnt][1].split(":");

                switch ( tmp[1] ) {
                    case "length": {
                        if ( targetObject.value.length < tmp[2] || targetObject.value.length > tmp[3] ) {
                            returnValue = false;
                        }
                        break;
                    }
                    case "length_min": {
                        if ( targetObject.value.length < tmp[2] ) {
                            returnValue = false;
                        }
                        break;
                    }
                    case "email": {
                        if ( !targetObject.value.match(/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+.[a-zA-Z.]+$/) ) {
                            returnValue = false;
                        }
                        break;
                    }
                    case "number": {
                        if ( targetObject.value.match(/[^0-9]/gi) ) {
                            returnValue = false;
                        }
                        break;
                    }
                    case "range": {
                        if ( !(parseInt(targetObject.value) >= parseInt(tmp[2]) && parseInt(targetObject.value) <= parseInt(tmp[3])) ) {
                            returnValue = false;
                        }
                        break;
                    }
                    case "jumin": {
                        tempValue = 0;

                        for (var i=0; i<=5 ; i++)    tempValue += ((i%8+2) * parseInt(tmp[2].substring(i, i+1)));
                        for (var i=6; i<=11; i++)    tempValue += ((i%8+2) * parseInt(tmp[3].substring(i-6, i-5)));
                                                     tempValue  = (11 - (tempValue %11))%10;

                        if ( tempValue != juminno2.substring(6, 7) ) {
                            returnValue = false;
                        }
                        break;
                    }
                    case "radio": {
                        tempValue = 0;
                        for ( i=0; i<targetObject.length; i++ ) {
                            switch ( tmp[2] ) {
                                case "checkCount": {
                                    if ( targetObject[i].checked                                    ) {    tempValue++;    }
                                    break;
                                }
                                default: {
                                    if ( targetObject[i].checked && targetObject[i].value == tmp[2] ) {    tempValue++;    }
                                    break;
                                }
                            }
                        }
                        if ( tempValue == 0 ) {    returnValue = false;    }
                        break;
                    }
                    case "date": {
                        switch ( tmp[2] ) {
                            case "yyyy-mm-dd": {
                                tmpYear  = targetObject.value.substr(0, 4);
                                tmpMonth = targetObject.value.substr(5, 2)-1;
                                tmpDay   = targetObject.value.substr(8, 2);

                                if ( targetObject.value.substr(4,1)=="-" && targetObject.value.substr(7, 1)=="-" ) {
                                    tmpDate  = new Date(tmpYear, tmpMonth, tmpDay);

                                    tmpYear1  = tmpDate.getFullYear();
                                    tmpMonth1 = tmpDate.getMonth();
                                    tmpDay1   = tmpDate.getDate();

                                    if ( tmpYear!=tmpYear1 || tmpMonth!=tmpMonth1 || tmpDay!=tmpDay1 ) {
                                        returnValue = false;
                                    }
                                }
                                else {
                                    returnValue = false;
                                }
                                break;
                            }
                        }
                        break;
                    }
                }

                if ( !returnValue ) {
                    alert( arrayValidate[cnt][2] );
                    if ( tmp[0] == "Y" )    {    targetObject.focus();    }
                    break;
                }
            }
        }

        return returnValue;
    }